package com.akrc.blog.controller;

import com.akrc.blog.mapper.UserMapper;
import com.akrc.blog.model.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
class UserController {
	final UserMapper userMapper;

	public UserController(UserMapper userMapper) {
		this.userMapper = userMapper;
	}

	@GetMapping("/user/{id}")
	User user(@PathVariable Integer id) {
		return userMapper.getByID(id);
	}
}
